package com.ningju.procurement.core.questionnaire.service;

import com.ningju.procurement.common.service.BaseServiceImpl;
import com.ningju.procurement.core.questionnaire.bean.Project;
import com.ningju.procurement.core.questionnaire.dao.ProjectDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.List;

/**
 * 源评测项目管理
 */
@Service
public class ProjectService extends BaseServiceImpl<ProjectDao, Project> {

    @Autowired
    private ProjectDao projectDao;

    public List<Project> getProjectList() {
        return projectDao.selectAll();
    }

    public boolean save(Project project) {
        Assert.notNull(project);
        return super.save(projectDao, project);
    }

    public boolean destory(Project project) {
        Assert.notNull(project);
        return projectDao.deleteById(project.getId()) > 0;
    }

}
